home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / SampleOscControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  3.8 KB  |  112 lines  |  [TEXT/KAHL]

  1. /* SampleOscControl.h */
  2.  
  3. #ifndef Included_SampleOscControl_h
  4. #define Included_SampleOscControl_h
  5.  
  6. /* SampleOscControl module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* FixedPoint */
  12. /* 64BitMath */
  13. /* FastFixedPoint */
  14. /* ModulationSpecifier */
  15. /* Multisampler */
  16. /* EnvelopeState */
  17. /* Envelope */
  18. /* LFOGenerator */
  19. /* LFOListSpecifier */
  20. /* SampleConsts */
  21. /* Memory */
  22. /* OscillatorSpecifier */
  23. /* FastModulation */
  24. /* ErrorDaemon */
  25.  
  26. #include "FixedPoint.h"
  27. #include "FastFixedPoint.h"
  28. #include "ModulationSpecifier.h"
  29.  
  30. struct SampleTemplateRec;
  31. typedef struct SampleTemplateRec SampleTemplateRec;
  32.  
  33. struct SampleStateRec;
  34. typedef struct SampleStateRec SampleStateRec;
  35.  
  36. /* forwards */
  37. struct OscillatorRec;
  38. struct ArrayRec;
  39. struct ErrorDaemonRec;
  40.  
  41. /* get rid of all cached memory for state or template records */
  42. void                                    FlushSampleOscControl(void);
  43.  
  44. /* perform one envelope update cycle */
  45. void                                    UpdateSampleEnvelopes(SampleStateRec* State);
  46.  
  47. /* dispose of the sample state record */
  48. void                                    DisposeSampleState(SampleStateRec* State);
  49.  
  50. /* dispose of the sample information template */
  51. void                                    DisposeSampleTemplate(SampleTemplateRec* Template);
  52.  
  53. /* create a new sample template */
  54. SampleTemplateRec*        NewSampleTemplate(struct OscillatorRec* Oscillator,
  55.                                                 float EnvelopeTicksPerSecond, long SamplingRate,
  56.                                                 MyBoolean Stereo, MyBoolean TimeInterp, MyBoolean WaveInterp,
  57.                                                 struct ErrorDaemonRec* ErrorDaemon);
  58.  
  59. /* create a new sample state object. */
  60. SampleStateRec*                NewSampleState(SampleTemplateRec* Template,
  61.                                                 float FreqForMultisampling, float Accent1, float Accent2,
  62.                                                 float Accent3, float Accent4, float Loudness, float HurryUp,
  63.                                                 long* PreOriginTimeOut, float StereoPosition,
  64.                                                 float InitialFrequency);
  65.  
  66. /* fix up pre-origin time for the sample state object */
  67. void                                    FixUpSampleStatePreOrigin(SampleStateRec* State,
  68.                                                 long ActualPreOrigin);
  69.  
  70. /* set a new frequency for a state object.  used for portamento */
  71. /* and modulation of frequency (vibrato) */
  72. void                                    SampleStateNewFrequency(SampleStateRec* State,
  73.                                                 float NewFrequencyHertz);
  74.  
  75. /* send a key-up signal to one of the oscillators */
  76. void                                    SampleKeyUpSustain1(SampleStateRec* State);
  77. void                                    SampleKeyUpSustain2(SampleStateRec* State);
  78. void                                    SampleKeyUpSustain3(SampleStateRec* State);
  79.  
  80. /* restart a sample oscillator.  this is used for tie continuations */
  81. void                                    RestartSampleState(SampleStateRec* State,
  82.                                                 float NewFreqMultisampling, float NewAccent1, float NewAccent2,
  83.                                                 float NewAccent3, float NewAccent4, float NewLoudness,
  84.                                                 float NewHurryUp, MyBoolean RetriggerEnvelopes,
  85.                                                 float NewStereoPosition, float NewInitialFrequency);
  86.  
  87. /* generate a sequence of samples (called for each envelope clock) */
  88. void                                    SampleGenSamples(SampleStateRec* State,
  89.                                                 long SampleCount, largefixedsigned* RawBuffer);
  90.  
  91. /* find out if the sample oscillator has finished */
  92. MyBoolean                            SampleIsItFinished(SampleStateRec* State);
  93.  
  94. /* generate a single sample (called for modulation chains) */
  95. /* OutputPlace should have 1 entry for mono output or 2 entries for stereo output */
  96. float                                    SampleGenOneSample(SampleStateRec* State,
  97.                                                 ModulationTypes* PhaseGenModulateHow,
  98.                                                 float* PhaseGenModulationScaling,
  99.                                                 float* PhaseGenModulationOrigin,
  100.                                                 float* PhaseGenOldValues,
  101.                                                 long* PhaseGenIndirectionTable,
  102.                                                 long NumberOfPhaseGenModulators,
  103.                                                 ModulationTypes* OutputModulateHow,
  104.                                                 float* OutputModulationScaling,
  105.                                                 float* OutputModulationOrigin,
  106.                                                 float* OutputOldValues,
  107.                                                 long* OutputIndirectionTable,
  108.                                                 long NumberOfOutputModulators,
  109.                                                 largefixedsigned* OutputPlace);
  110.  
  111. #endif
  112.